import { createBrowserRouter }  from 'react-router-dom'
import Layout from '../pages/Layout/index'
import Login from '../pages/Login/index'
import List from '../pages/BookList/index'
import Article from '../pages/Article/index'
import Book from '../pages/Book/index'
import Person from '../pages/Person/index'
import PersonalPage from '../pages/PersonList/index'
import BorrowRecord from '../pages/BorrowRecord/index'
import AdminBookMg from '../pages/AdminBookMg/index'
import {BookMg,UserMg,AdminInfo,BorrowBookList} from  '../components/AdminBookMg/AllRouter'
// import { AuthRoute } from '@/components/Auth';
const router = createBrowserRouter(
  [
    { 
      path: '/', element:< Layout />,
      children: [
        { path: '/article', element: < Article /> },
        {path: '/list', element: < List />}
      ]
    },
    { 
      path: '/personlist', element: < PersonalPage />,
      children: [
        { index: true , element: < Person /> },
        { path: 'person', element: < Person /> },
        { path: 'borrow-record', element: < BorrowRecord /> }
      ]
    },
    { 
      path: '/adminbookMg', element: < AdminBookMg />,
      children: [
        { index: true, element: < AdminInfo /> },
        { path: 'adminInfo', element: < AdminInfo /> },
        { path: 'bookMg', element: < BookMg /> },
        { path: 'userMg', element: < UserMg /> },
        { path: 'borrowBookList', element: < BorrowBookList /> },
        // { path: 'borrowDefaultList', element: < BorrowDefaultList /> },
        // { path: 'bookForm', element: < BookForm /> }
      ] 
    },
    { path: '/book/:id', element: < Book />},
    { path: '/login', element: < Login /> },
    
  ]
)

export default router